package com.segersten.othello.service.akka.lobby;

import com.segersten.othello.service.akka.GameObjectPool;
import com.segersten.othello.service.akka.game.BoardActorFactory;
import com.segersten.othello.service.akka.lobby.dao.LoginRegistryDao;
import com.segersten.othello.service.akka.lobby.dao.OngoingGamesDao;
import com.segersten.othello.service.akka.lobby.dao.PlayerScoreDao;
import com.segersten.othello.service.akka.lobby.dao.RegisteredForMatchingDao;
import com.segersten.othello.service.akka.Actor;

public class DefaultLobbyServiceActorFactory implements LobbyServiceActorFactory {
	
	private static final long serialVersionUID = 1L;
	
	private BoardActorFactory boardActorFactory;

    private GameObjectPool gameObjectPool;

    private RegisteredForMatchingDao registeredForMatchingDao;

    private PlayerScoreDao playerScoreDao;

    private LoginRegistryDao loginRegistryDao;

    private OngoingGamesDao ongoingGamesDao;

	public DefaultLobbyServiceActorFactory(GameObjectPool gameObjectPool, 
	                BoardActorFactory boardActorFactory, 
	                RegisteredForMatchingDao registeredForMatchingDao,
	                PlayerScoreDao playerScoreDao,
	                LoginRegistryDao loginRegistryDao,
	                OngoingGamesDao ongoingGamesDao) {
		this.boardActorFactory = boardActorFactory;
		this.gameObjectPool = gameObjectPool;
		this.registeredForMatchingDao = registeredForMatchingDao;
		this.playerScoreDao = playerScoreDao;
		this.loginRegistryDao = loginRegistryDao;
		this.ongoingGamesDao = ongoingGamesDao;
	}

	@Override
    public Actor create() {
		return new LobbyServiceActor(gameObjectPool, 
		                            boardActorFactory, 
		                            registeredForMatchingDao, 
		                            playerScoreDao, 
		                            loginRegistryDao,
		                            ongoingGamesDao);
	}
}